
<template>
  <div class="execution">
    <basic-container>
      <avue-crud
        :permission="permissionList"
        v-model="form"
        v-bind="bindVal"
        v-on="onEvent"
        :page.sync="page">
      </avue-crud>
    </basic-container>
  </div>
</template>

<script>
import {
  fetchList,
  getObj,
  addObj,
  putObj,
  delObj,
  delBatch,getTypeValue
} from "@/api/subway/swstticketcheckdcp";
import { tableOption,nowDate } from "@/const/crud/subway/swstticketcheckdcp";
import { mapGetters } from "vuex";
import baseCrud from "@/mixins/base-crud";
import { dateFormat } from "@/util/date";

export default {
  name: "swstticketcheckdcp",
  mixins: [baseCrud("subway/swstticketcheckdcp")],
  data() {
    return {
      form: {
        checkDay:25,
        checkDate:''
        // page: {
        //   total: 0, // 总页数
        //   currentPage: 1, // 当前页数
        //   pageSize: 20 // 每页显示多少条
        // }
      },
      searchForm: {
        statisticsDate: nowDate
      }
    };
  },
  // create() {
  //   let now = new Date();
  //   getTypeValue('check_day').then(response => {
  //     this.checkDay = parseInt(response.data.data[0].value);
  //   });
  // },
  computed: {
    ...mapGetters(["permissions"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permissions.stm_swstotherfare_add, false),
        delBtn: this.vaildData(this.permissions.stm_swstotherfare_del, false),
        editBtn: this.vaildData(this.permissions.stm_swstotherfare_edit, false),
        delBatchBtn: this.vaildData(this.permissions.stm_swstotherfaret_delBatch,false)
      };
    },
  },
  methods: {    
    // getList() {
    //   fetchList(
    //     Object.assign(
    //       {current: this.page.currentPage,size: this.page.pageSize},this.searchForm
    //     )
    //   ).then((response)=>{
    //     this.tableData = response.data.data.records;
    //     this.page.total = response.data.data.total;
    //     //this.tableLoading = false
    //     //done();
    //   }).catch(e=>{
    //     //this.tableLoading = false
    //     //console.log(e)
    //     //done();
    //   });
    // },
    //   searchChange(form, done) {
    //     this.searchForm = form
    //     this.page.currentPage = 1
    //     this.getList(this.page);
    //     done();
    //   }
  }
}
</script>
